#ifndef ROLEADD_H
#define ROLEADD_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include "ettadatastruct.h"
#include "globaldef.h"
#include "blldataflow.h"
#include "sqlhelper.h"
#include "shadow.h"

namespace Ui {
class RoleAdd;
}

class RoleAdd : public QWidget
{
    Q_OBJECT

public:
    explicit RoleAdd(QWidget *parent = nullptr);
    ~RoleAdd();
    void clearInput();

private slots:
    void on_btnConfirmAddRole_clicked();
    void on_btnCancelAddRole_clicked();
    void on_btnClose_clicked();
    void on_lineNewRoleName_returnPressed();
    void retranslateUiSlot();

private:
    void initWidget();
    EttaError checkRoleValid();
    bool checkRoleName();

protected:
    void paintEvent(QPaintEvent *event);
    void showEvent(QShowEvent *);

private:
    Ui::RoleAdd *ui;
    BllDataFlow * bdf;
    SqlHelper * sqlHelper;
    Role role;

};

#endif // ROLEADD_H
